<template>
	<view class="uiwu">
		<view class="uiwu-title">{{article.title}}</view>
		<view class="uiwu-timeese uiwu-flex uiwu-flex-space">
			<text class="time">发布时间：{{article.create_time}}</text>
			<text class="ese">{{article.visit}}人浏览</text>
		</view>
		<view class="uiwu-contetn">
			<mp-html :content="article.content"></mp-html>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				article:''
			};
		},
		onLoad({id,type}) {
			this.getArticle(id,type)
		},
		methods:{
			/**
			 * 获取公告详情
			 */
			async getArticle(id,type){
				const { data , msg , code } = await this.uiwu.get ({
					url: type == 'help' ? 'help/detail' : 'gg/detail',
					data:{id}
				})
				if(!code) return this.uiwu.toast(msg)
				data.content = this.uiwu.richtext(data.content)
				this.article = data
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #fff;
	}
	.uiwu{
		padding: 20rpx 30rpx;
	}
	.uiwu-title{
		font-size: 32rpx;
		font-weight: bold;
		color: #1A1A1A;
	}
	.uiwu-timeese{
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		margin-top: 20rpx;
	}
	.uiwu-contetn{
		font-size: 28rpx;
		color: #333;
		padding-top: 30rpx;
	}
</style>
